package com.regent.central.bill.repository.mrp;

import com.regent.central.bill.core.mrp.ActionMaterialArriveCheckShrunk;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

@Repository
public interface ActionMaterialArriveCheckShrunkMapper extends Mapper<ActionMaterialArriveCheckShrunk> {
    /**
     * 根据到料单ID和物料skuID查出一个验布缩布
     */
    ActionMaterialArriveCheckShrunk getByBillArriveAndSku(@Param("billMaterialArriveId") String billMaterialArriveId, @Param("materialSkuId") String materialSkuId);

    /**
     * 关联验布引起的库存变动记录
     */
    int checkStockChange(@Param("billMaterialArriveId") String billMaterialArriveId,
                         @Param("materialSkuId") String materialSkuId,
                         @Param("stockChangeId") String stockChangeId);

    /**
     * 关联缩布引起的库存变动记录
     */
    int shrunkStockChange(@Param("billMaterialArriveId") String billMaterialArriveId,
                          @Param("materialSkuId") String materialSkuId,
                          @Param("stockChangeId") String stockChangeId);
}